#pragma once

#include <array>

/// @brief The stucture for storing the data of device Rx gain values for a specific gain value.
struct RxGainRow {
    int lna; ///< The value of the Low Noise Amplifier.
    int pga; ///< The value of the Programmable Gain Amplifier.
};

static std::array<RxGainRow, 51> rxGainTable{ {
    { 1, 12 },
    { 1, 13 },
    { 2, 12 },
    { 2, 13 },
    { 2, 14 },
    { 3, 12 },
    { 3, 13 },
    { 3, 14 },
    { 4, 12 },
    { 4, 13 },
    { 4, 14 },
    { 5, 12 },
    { 5, 13 },
    { 5, 14 },
    { 6, 12 },
    { 6, 13 },
    { 6, 14 },
    { 7, 12 },
    { 7, 13 },
    { 7, 14 },
    { 8, 12 },
    { 8, 13 },
    { 8, 14 },
    { 9, 12 },
    { 9, 13 },
    { 9, 14 },
    { 10, 12 },
    { 11, 12 },
    { 12, 12 },
    { 13, 12 },
    { 14, 12 },
    { 15, 12 },
    { 15, 13 },
    { 15, 14 },
    { 15, 15 },
    { 15, 16 },
    { 15, 17 },
    { 15, 18 },
    { 15, 19 },
    { 15, 20 },
    { 15, 21 },
    { 15, 22 },
    { 15, 23 },
    { 15, 24 },
    { 15, 25 },
    { 15, 26 },
    { 15, 27 },
    { 15, 28 },
    { 15, 29 },
    { 15, 30 },
    { 15, 31 },
} };

/// @brief The stucture for storing the data of device Tx gain values for a specific gain value.
struct TxGainRow {
    int main; ///< The gain output power of the TXPAD.
    int lin; ///< The gain of the linearizing part of of the TXPAD
};

static std::array<TxGainRow, 51> txGainTable{ {
    { 30, 30 },
    { 30, 30 },
    { 29, 29 },
    { 29, 29 },
    { 28, 28 },
    { 28, 28 },
    { 27, 27 },
    { 27, 27 },
    { 26, 26 },
    { 26, 26 },
    { 25, 25 },
    { 25, 25 },
    { 24, 24 },
    { 24, 24 },
    { 23, 23 },
    { 23, 23 },
    { 22, 22 },
    { 22, 22 },
    { 21, 21 },
    { 21, 21 },
    { 20, 20 },
    { 20, 20 },
    { 19, 19 },
    { 19, 19 },
    { 18, 18 },
    { 18, 18 },
    { 17, 17 },
    { 17, 17 },
    { 16, 16 },
    { 16, 16 },
    { 15, 15 },
    { 15, 15 },
    { 14, 14 },
    { 14, 14 },
    { 13, 13 },
    { 13, 13 },
    { 12, 12 },
    { 12, 12 },
    { 11, 11 },
    { 11, 11 },
    { 10, 10 },
    { 9, 9 },
    { 8, 8 },
    { 7, 7 },
    { 6, 6 },
    { 5, 5 },
    { 4, 4 },
    { 3, 3 },
    { 2, 2 },
    { 1, 1 },
    { 0, 0 },
} };
